-
Notifications
You must be signed in to change notification settings - Fork 6k
Move samples used in Catch exception section to snippets folder #24084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...exceptions/snippets/how-to-use-specific-exceptions-in-a-catch-block/csharp/catchexception.cs
Outdated
Show resolved
Hide resolved
Hey, @adegeo and @BillWagner is Snippets 5000 designed to compile C++, I do not recall whether or not we've been handling that? I'd be happy to approve and merge these changes, but there is a build failure - missing project. Thank you very much for these improvements @nemrism |
@@ -18,8 +19,9 @@ Place any code statements that might raise or throw an exception in a `try` bloc | |||
|
|||
In the following example, a <xref:System.IO.StreamReader> opens a file called *data.txt* and retrieves a line from the file. Since the code might throw any of three exceptions, it's placed in a `try` block. Three `catch` blocks catch the exceptions and handle them by displaying the results to the console. | |||
|
|||
[!code-csharp[CatchException#3](~/samples/snippets/csharp/VS_Snippets_CLR/CatchException/CS/catchexception2.cs#3)] | |||
[!code-vb[CatchException#3](~/samples/snippets/visualbasic/VS_Snippets_CLR/CatchException/VB/catchexception2.vb#3)] | |||
:::code language="cpp" source="./snippets/how-to-use-the-try-catch-block-to-catch-exceptions/cpp/catchexception.cpp" id="Snippet3"::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding C++ here, much appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen it while preparing the move of the other page samples.
I also left some unused files in the samples folder, I did not find any usage of them, but did not want to delete them anyway.
ping @adegeo The build failure here is (I think) the same one we fixed in docs-desktop yesterday. Would you agree? If so, I'll open a PR for this repo and get it merged. |
…ns-in-a-catch-block/csharp/catchexception.cs Co-authored-by: David Pine <[email protected]>
The error here is that there isn't a project for the CPP code files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving and merging. (The last comment on the CI build got lost while out of office).
I apologize for the delay.
Summary
Move samples to snippets folder from:
Contributes to #15006
Internal preview